package com.swanclouds.redfish.chassis.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonRootName;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.util.List;


/**
 * @author 张立强 
 */
public class DrivesModel {

    /**指定驱动器资源的访问路径**/
    @JsonProperty("@odata.id")
    private String dataId;

    /**指定驱动器资源模型的OData描述信息**/
    @JsonProperty("@odata.context")
    private String context;

    /**指定驱动器资源的类型**/
    @JsonProperty("@odata.type")
    private String type;

    /**指定驱动器资源的ID**/
    @JsonProperty("Id")
    private String id;

    /**指定驱动器资源的名称**/
    @JsonProperty("Name")
    private String name;

    /**指定驱动器型号**/
    @JsonProperty("Model")
    private String model;

    /**指定驱动器的版本信息**/
    @JsonProperty("Revision")
    private String revision;

    /**指定驱动器容量，单位为字节**/
    @JsonProperty("CapacityBytes")
    private Long capacityBytes;

    /**指定驱动器的序列号**/
    @JsonProperty("SerialNumber")
    private String serialNumber;

    /**指定驱动器遵从的协议 ● SPI ● PCIe ● AHCI ● UHCI ● SAS ● SATA ● USB ● NVMe ● FC ● iSCSI ● FCoE ● NVMeOverFabrics ● SMB ● NFSv3 ● NFSv4
     ● HTTP
     ● HTTPS
     ● FTP
     ● SFTP**/
    @JsonProperty("Protocol")
    private String protocol;

    /**指定驱动器的介质类型
     ● HDD
     ● SSD
     ● SMR**/
    @JsonProperty("MediaType")
    private String mediaType;

    /****/
    @JsonProperty("JbodType")
    private String jbodType;

    /**指定硬盘的温度**/
    @JsonProperty("DiskTemperatureCelsius")
    private Integer diskTemperatureCelsius;

    /**指定驱动器是否检测到预故障，包括：
     true
     false**/
    @JsonProperty("FailurePredicted")
    private String failurePredicted;

    /**指定驱动器接口的最大速率**/
    @JsonProperty("CapableSpeedGbs")
    private Integer capableSpeedGbs;

    /**指定硬盘的盘体状态（该字段只针对于连接RAID的硬盘），包括：
     UNCONFIGURED_GOOD
     UNCONFIGURED_BAD
     HOT_SPARE
     Offline
     Failed
     Rebuild
     Online
     JBOD**/
    @JsonProperty("FirmwareStatus")
    private String firmwareStatus;

    /**指定驱动器的制造商**/
    @JsonProperty("Manufacturer")
    private String manufacturer;

    /**指定驱动器的状态，包
     括：
     ● State：驱动器使能状
     态
     ● Health：驱动器健康状
     态
     ● Severity：驱动器的自
     定义健康状态**/
    @JsonProperty("Status")
    private StatusModel status;

    /**指定PCIe设备资源的访问路径**/
    @JsonProperty("Oem")
    private Oem oem;

    /**指定驱动器接口的协商速率**/
    @JsonProperty("NegotiatedSpeedGbs")
    private Integer negotiatedSpeedGbs;

    /**指定驱动器的剩余寿命百分比**/
    @JsonProperty("PredictedMediaLifeLeftPercent")
    private String predictedMediaLifeLeftPercent;

    /**指定驱动器的定位指示灯
     状态，包括：
     ● Kff
     ● Blinking**/
    @JsonProperty("IndicatorLED")
    private String indicatorLED;

    /**指定驱动器的热备状态，
     包括：
     ● None
     ● Global
     ● Dedicated**/
    @JsonProperty("HotspareType")
    private String hotspareType;

    /**指定驱动器的指示灯状
     态，包括
     ● OK
     ● Fail
     ● Rebuild
     ● PredictiveFailureAnaly
     sis
     ● Hotspare
     ● InAFailedArray
     ● InACriticalArray**/
    @JsonProperty("StatusIndicator")
    private String statusIndicator;

    /**指定驱动器丝印**/
    @JsonProperty("Location")
    private List<Location> location;


   
    public String getDataId() {
        return this.dataId;
    }

   
    public String getContext() {
        return this.context;
    }

   
    public String getType() {
        return this.type;
    }

   
    public String getId() {
        return this.id;
    }

   
    public String getName() {
        return this.name;
    }

    public String getModel() {
        return model;
    }

    public String getRevision() {
        return revision;
    }

    public Long getCapacityBytes() {
        return capacityBytes;
    }

    public String getSerialNumber() {
        return serialNumber;
    }

    public String getProtocol() {
        return protocol;
    }

    public String getMediaType() {
        return mediaType;
    }


    public String getJbodType() {
        return jbodType;
    }

    public Integer getDiskTemperatureCelsius() {
        return diskTemperatureCelsius;
    }

    public String getFailurePredicted() {
        return failurePredicted;
    }

    public Integer getCapableSpeedGbs() {
        return capableSpeedGbs;
    }

    public String getFirmwareStatus() {
        return firmwareStatus;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public StatusModel getStatus() {
        return status;
    }

    public Oem getOem() {
        return this.oem;
    }

    public Integer getNegotiatedSpeedGbs() {
        return negotiatedSpeedGbs;
    }

    public String getPredictedMediaLifeLeftPercent() {
        return predictedMediaLifeLeftPercent;
    }

    public String getIndicatorLED() {
        return indicatorLED;
    }

    public String getHotspareType() {
        return hotspareType;
    }

    public String getStatusIndicator() {
        return statusIndicator;
    }

    public List<Location> getLocation() {
        return location;
    }

    @JsonRootName("Status")
    public static class StatusModel {

        @JsonProperty("State")
        private String state;
        /**
         * 驱动器使能状态
         *
         * @return state
         */
       
        public String getState() {
            return this.state;
        }

        @JsonProperty("Health")
        private String health;
        /**
         * 驱动器健康状态
         *
         * @return health
         */
       
        public String getHealth() {
            return this.health;
        }

        @JsonProperty("Severity")
        private String severity;
        /**
         * 驱动器的自定义健康状态
         *
         * @return severity
         */
       
        public String getSeverity() {
            return this.severity;
        }

       
        public String toString() {
            ObjectMapper objectMapper = new ObjectMapper();
            try {
                return objectMapper.writeValueAsString(this);
            } catch (JsonProcessingException e) {
            }
            return "StatusModel {" +
                    "state='" + state + '\'' +
                    ", health='" + health + '\'' +
                    ", severity='" + severity + '\'' +
                    '}';
        }
    }

    @JsonRootName("Oem")
    public static class Oem {

        @JsonProperty("BMC")
        private Bmc bmc;

        public Bmc getBmc() {
            return this.bmc;
        }

        public void setBmc(Bmc bmc) {
            this.bmc = bmc;
        }

        @JsonRootName("BMC")
        public static class Bmc {

            /**
             * 驱动器模式类型
             */
            @JsonProperty("Mode")
            private String mode;
            /**
             * 驱动器Smart 检测状态（限 NVME 盘）
             */
            @JsonProperty("SMART")
            private String smart;
            /**
             * 定驱动器厂商ID（只限NVME盘）
             */
            @JsonProperty("vendorID")
            private String VendorID;
            /**
             * 驱动器最大链接宽度（只限NVME 盘）
             */
            @JsonProperty("MaxLinkWidth")
            private String maxLinkWidth;
            /**
             * 驱动器接口的协商速率
             */
            @JsonProperty("NegotiatedSpeedGbs")
            private Integer negotiatedSpeedGbs;
            /**
             * 驱动器的剩余寿命百分比
             */
            @JsonProperty("PredictedMediaLifeLeftPercent")
            private Integer predictedMediaLifeLeftPercent;
            /**
             * 驱动器的定位指示灯状态[ Off , Blinking]
             */
            @JsonProperty("IndicatorLED")
            private String indicatorLED;
            /**
             * 驱动器的热备状态，包括：
             * [None, Global , Dedicated]
             */
            @JsonProperty("HotspareType")
            private String hotspareType;
            /**
             * 驱动器的指示灯状态，包括
             * [ OK, Fail , Rebuild, PredictiveFailureAnalysis,Hotspare, InAFailedArray, InACriticalArray]
             */
            @JsonProperty("StatusIndicator")
            private String statusIndicator;

            public String getMode() {
                return this.mode;
            }

            public void setMode(String mode) {
                this.mode = mode;
            }

            public String getSmart() {
                return this.smart;
            }

            public void setSmart(String smart) {
                this.smart = smart;
            }

            public String getIsVendorID() {
                return this.VendorID;
            }

            public void setIsVendorID(String VendorID) {
                this.VendorID = VendorID;
            }

            public String getMaxLinkWidth() {
                return this.maxLinkWidth;
            }

            public void setMaxLinkWidth(String maxLinkWidth) {
                this.maxLinkWidth = maxLinkWidth;
            }

            public Integer getNegotiatedSpeedGbs() {
                return this.negotiatedSpeedGbs;
            }

            public void setNegotiatedSpeedGbs(Integer negotiatedSpeedGbs) {
                this.negotiatedSpeedGbs = negotiatedSpeedGbs;
            }

            public Integer getPredictedMediaLifeLeftPercent() {
                return this.predictedMediaLifeLeftPercent;
            }

            public void setPredictedMediaLifeLeftPercent(Integer predictedMediaLifeLeftPercent) {
                this.predictedMediaLifeLeftPercent = predictedMediaLifeLeftPercent;
            }

            public String getIndicatorLED() {
                return this.indicatorLED;
            }

            public void setIndicatorLED(String indicatorLED) {
                this.indicatorLED = indicatorLED;
            }

            public String getHotspareType() {
                return this.hotspareType;
            }

            public void setHotspareType(String hotspareType) {
                this.hotspareType = hotspareType;
            }

            public String getStatusIndicator() {
                return this.statusIndicator;
            }

            public void setStatusIndicator(String statusIndicator) {
                this.statusIndicator = statusIndicator;
            }
        }
    }

    @JsonRootName("Location")
    public static class Location {
        /**
         * 驱动器丝印信息
         */
        @JsonProperty("Info")
        private String info;
        /**
         * 驱动器丝印格式
         */
        @JsonProperty("InfoFormat")
        private String infoFormat;
        /**
         * 硬盘的温度
         */
        @JsonProperty("DiskTemperatureCelsius")
        private Integer diskTemperatureCelsius;
        /**
         * 硬盘的盘体状态（该字段只针对于连接RAID 的硬盘），包括：
         * [UNCONFIGURED_GOOD, UNCONFIGURED_BAD, HOT_SPARE, Offline, Failed, Rebuild, Online, JBOD]
         */
        @JsonProperty("FirmwareStatus")
        private String firmwareStatus;

        public String getInfo() {
            return this.info;
        }

        public void setInfo(String info) {
            this.info = info;
        }

        public String getInfoFormat() {
            return this.infoFormat;
        }

        public void setInfoFormat(String infoFormat) {
            this.infoFormat = infoFormat;
        }

        public Integer getDiskTemperatureCelsius() {
            return this.diskTemperatureCelsius;
        }

        public void setDiskTemperatureCelsius(Integer diskTemperatureCelsius) {
            this.diskTemperatureCelsius = diskTemperatureCelsius;
        }

        public String getFirmwareStatus() {
            return this.firmwareStatus;
        }

        public void setFirmwareStatus(String firmwareStatus) {
            this.firmwareStatus = firmwareStatus;
        }
    }

   
    public String toString() {
        ObjectMapper objectMapper = new ObjectMapper();
        try {
            return objectMapper.writeValueAsString(this);
        } catch (JsonProcessingException e) {
        }
        return "DrivesModel {" +
                "dataId='" + dataId + '\'' +
                ", context='" + context + '\'' +
                ", type='" + type + '\'' +
                ", id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", model='" + model + '\'' +
                ", revision='" + revision + '\'' +
                ", capacityBytes=" + capacityBytes +
                ", serialNumber='" + serialNumber + '\'' +
                ", protocol='" + protocol + '\'' +
                ", mediaType='" + mediaType + '\'' +
                ", jbodType='" + jbodType + '\'' +
                ", diskTemperatureCelsius='" + diskTemperatureCelsius + '\'' +
                ", failurePredicted='" + failurePredicted + '\'' +
                ", capableSpeedGbs='" + capableSpeedGbs + '\'' +
                ", firmwareStatus='" + firmwareStatus + '\'' +
                ", manufacturer='" + manufacturer + '\'' +
                ", status=" + status +
                ", oem=" + oem +
                ", negotiatedSpeedGbs='" + negotiatedSpeedGbs + '\'' +
                ", predictedMediaLifeLeftPercent='" + predictedMediaLifeLeftPercent + '\'' +
                ", indicatorLED='" + indicatorLED + '\'' +
                ", hotspareType='" + hotspareType + '\'' +
                ", statusIndicator='" + statusIndicator + '\'' +
                ", location=" + location +
                '}';
    }

}
